<template>
  <div>
    <template v-if="historyMsgList.length>0">
      <wx-chat-history-item
        v-for="(hmsg,index) in historyMsgList"
        :hContent="hmsg.body"
        :hDirection="hmsg.chatDirection"
        :hCTime="hmsg.createTime"
        :hDoctorId="hmsg.doctorId"
        :servertype="servertype"
        :key="hmsg.index"
        :i="index"
        @showOpinions="showOpinion"
      ></wx-chat-history-item>
    </template>
    <!-- <ul id="chat-list" class="m-chat-list p-chat-list">
        <li class="loadmore" v-if="canLoadMore" @click="loadMore">---- 点击加载更多 ----</li>
        <li class="cannot-loadmore" v-else>---- 已无更多记录 ----</li>
        <wx-chat-history-item
        v-for="(hmsg,index) in historyMsgList"
        :hContent="hmsg.body"
        :hDirection="hmsg.chatDirection"
        :hCTime="hmsg.createTime"
        :hDoctorId="hmsg.doctorId"
        :servertype="servertype"
        :key="hmsg.index"
        :i="index"
        @showOpinions="showOpinion"
      ></wx-chat-history-item>
    </ul> -->
  </div>
</template>
<script type="text/javascript">
  // import wxChatItem from './wxChatItem'
  import wxChatHistoryItem from './wxChatHistoryItem'

  export default {
    components: {
      // wxChatItem,
      wxChatHistoryItem
    },
    props: {
      historyMsgList:{
        type:Array,
        default (){
          return  {}
        }
      },
      servertype: [Number, String],
    },
    data () {
      return {}
    },
    methods: {
      showOpinion(obj){
        this.$emit('showOpinionEvent',obj);
      },
    }
  }
</script>